package org.llc.bpmn.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.llc.bpmn.model.qo.PageQo;
import org.llc.bpmn.model.vo.PageVo;
import org.llc.bpmn.service.BpmTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Api(tags = "流程模板")
@RestController
public class BpmTemplateController {

    @Autowired
    BpmTemplateService bpmTemplateService;

    @ApiOperation("部署流程模板")
    @PostMapping("/createBpmTemplate")
    public void createBpmTemplate(@RequestParam("file") MultipartFile file){
        bpmTemplateService.createBpmTemplate(file);
    }

    @ApiOperation("查询已部署的流程模板")
    @GetMapping("/list")
    public PageVo list(PageQo pageQo){
        PageVo result = bpmTemplateService.list(pageQo);
        return result;
    }

    @ApiOperation("更新流程模板")
    @PutMapping("/update")
    public void update(){

    }

    @ApiOperation("删除流程模板")
    @DeleteMapping("/delete/{id}")
    public void delete(String id){

    }

    @ApiOperation("查看流程模板详情")
    @GetMapping("/detail")
    public void detail(String id){

    }


}
